package com.fs.jzzn.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.fs.jzzn.pojo.Income;
/**
 * @author TiddlerCJ
 */
public interface IncomeRepository extends JpaRepository<Income,String>, JpaSpecificationExecutor<Income>{
	//根据项目查询对应的收入记录
	@Query(value="SELECT p.* FROM p_income p WHERE p.p_no IN (SELECT i.p_no FROM p_project i WHERE i.contract_no=?1)",nativeQuery=true)
	List<Income> findBycontractNo(String contractNo);
}
